private async Task RegisterAccount()
{
    if (!CanRegister) return;
    try
    {
        var result = await _accountRepo.RegisterUser(RegisterModel);
        RegistrationSucceeded = true;
        _navManager.NavigateTo("/account/login");
    }
    catch (Exception e)
    {
        Console.WriteLine(e);
        throw;
    }
}  